﻿using MslDiary.Utils;
using System;
using System.Windows.Controls;
using System.Windows.Input;

namespace MslDiary.View
{
    /// <summary>
    /// Config.xaml 的交互逻辑
    /// </summary>
    public partial class Config 
    {
        public Config()
        {
            InitializeComponent();
            this.pbOncePwd.PasswordChanged += OnBindedPasswordChanged;
            this.pbSecondPwd.PasswordChanged += OnBindedPasswordChanged;
            this.pbDbPwd.PasswordChanged += OnBindedPasswordChanged;
            this.pbOnceDbPwd.PasswordChanged += OnBindedPasswordChanged;
            this.pbTwoDbPwd.PasswordChanged += OnBindedPasswordChanged;
        }
        private void OnBindedPasswordChanged(object sender, System.Windows.RoutedEventArgs e)
        {
            PasswordBox passwordtext = (PasswordBox)sender;
            PasswordBoxHelper.SetPasswordBoxSelection(passwordtext, passwordtext.Password.Length + 1, passwordtext.Password.Length + 1);
        }
    }
}
